home *** CD-ROM | disk | FTP | other *** search
/ MacTech 1 to 12 / MacTech-vol-1-12.toast / Source / MacTech® Magazine / Volume 09 - 1993 / 09.06 Jun 93 / TReportPrinter / TDemoApplication.cp < prev    next >
Encoding:
Text File  |  1992-11-01  |  1.1 KB  |  42 lines  |  [TEXT/MPS ]

  1. #include <MacApp.h>
  2.  
  3. #include "TDemoApplication.h"
  4. #include "TDemoDocument.h"
  5.  
  6. //----------------------------------------------------------------------------------------
  7. // TDemoApplication::IDemoApplication
  8. //----------------------------------------------------------------------------------------
  9. #pragma segment AInit
  10. pascal void TDemoApplication::IDemoApplication()
  11. {
  12.     macroDontDeadStrip(TReportStatusWindow);
  13.  
  14.     this->IApplication(kFileType,kSignature);
  15. }
  16.  
  17. //----------------------------------------------------------------------------------------
  18. // TDemoApplication::DoMakeDocument
  19. //----------------------------------------------------------------------------------------
  20. #pragma segment MAOpen
  21. pascal TDocument* TDemoApplication::DoMakeDocument(CommandNumber, TFile* itsFile)
  22. {
  23.     FailInfo    fi;
  24.     TDemoDocument* aDocument = nil;
  25.  
  26.     VOLATILE(aDocument);
  27.     
  28.     if(fi.Try()) {
  29.         aDocument = new TDemoDocument;
  30.         aDocument->IDemoDocument(itsFile, '????');
  31.         fi.Success();
  32.     }
  33.     else {
  34.         if(aDocument) 
  35.             aDocument = (TDemoDocument *)FreeIfObject(aDocument);
  36.         fi.ReSignal();
  37.     }
  38.     return aDocument;
  39.  
  40. }
  41.  
  42.